	$(function(){
		//商品分类部分 轮播图上面
		//悬浮到每个可展示的类别时，背景变为白色 展示其商品
		//永生花，蛋糕，礼品分类
		$(".dropdown-cate-item.cate-pop").mouseenter(function(){
			//鼠标进入
			$(this).children(":header").css("color","black");//标题标签字体颜色为黑色
			$(this).children("h4").children("a").css("color","black");
			$(this).css("background-color","#FFFFFF");
			$(this).children(".right-pop").show();
			let flag = this.getElementsByTagName("ul")[0]||false;
			if(!flag){
				$(this).children("h4").children("a").mousemove(function(){
					$(this).css("color","#FF734C");
				});
				$(this).children("h4").children("a").mouseout(function(){
					$(this).css("color","black");
				});
			}else{
				let ula = $(this).children("ul").get(0).getElementsByTagName("a");
				for(let i = 0;i<ula.length;i++){
					ula[i].style.color="black";
				}
				$(ula).mousemove(function(){
					$(this).css("color","#FF734C");
				});
				$(ula).mouseout(function(){
					$(this).css("color","black");
				});
//				console.log("我执行了"+ula.length);
			}
		});
		$(".dropdown-cate-item.cate-pop").mouseleave(function(){
			//鼠标离开
			$(this).children(":header").css("color","#FFFFFF");
			$(this).children("h4").children("a").css("color","#FFFFFF");
			$(this).css("background-color","rgba(113,115,116,0)");
			$(this).children(".right-pop").hide();
			let ula = $(this).children("ul").get(0).getElementsByTagName("a");
			for(let i = 0;i<ula.length;i++){
				ula[i].style.color="#FFFFFF";
			}
		});
		//分类导航结束
		//侧边栏
		$("#referElem .rightBar-list li").hover(
			function(){
				$(this).children("a").children("span").css("color","#FF734C");
				$(this).children("div").show();
			},
			function(){
				$(this).children("a").children("span").eq(0).css("color","gray");
				$(this).children("a").children("span").eq(1).css("color","rgba(35, 38, 40, 0.9)");
				$(this).children("div").hide();
			}
		);
		//点击回顶部
		$("#referElem .rightBar-list li:last-child").click(function(){
			$(window).scrollTop(0);
			return false;
		});
		//给window绑定事件 固定侧边栏
		$(window).scroll(function(){
			if($(this).scrollTop()>=774){
				$("#rightBar").css("position","fixed");
			}else{
				$("#rightBar").css("position","absolute");
			}
		});
		//楼层 爱情鲜花
		$(".fl-products-item").hover(function(){
			$(this.getElementsByTagName("p")).css("color","#FF734C");
			this.getElementsByTagName("img")[0].style.transform ="scale(1.08,1.08)";
		},
		function(){
			$(this.getElementsByTagName("p")).css("color","black");
			this.getElementsByTagName("img")[0].style.transform ="scale(1)";
		});
		//楼层 蛋糕 悬浮选择 城市
		$(".f-cake-title-box-r").mouseenter(function(){
			$(this.getElementsByClassName("icon-city-arrow")[0]).css("transform","rotate(90deg)");
			$(this).children(".f-cake-dropdown-pop").show();
		});
		$(".f-cake-title-box-r").mouseleave(function(){
			$(this.getElementsByClassName("icon-city-arrow")[0]).css("transform","rotate(0)");
			$(this).children(".f-cake-dropdown-pop").hide();
		});
		//设置类名为fl元素的背景颜色
		$(".fl:even").css("background-color","#F7F9FA");
		$(".fl:odd").css("background-color","#E9ECF0");
	});
	//实现轮播图
	$(function(){
		//大图轮播开始
		funLunBo(0);
		//获取图片的数量
		var bigImgNum = $("#mainCarousel .carousel-inner").children("div").length;
		var imgindex = 0; // 默认图片索引下标
		//让图片轮播显示
		var imgTime = setInterval(function(){
			funLunBo(imgindex);
			imgindex++;
			if(imgindex>=bigImgNum)
				imgindex=0;
		},3000);
		//鼠标悬浮进图中自动轮播停止，悬浮出继续轮播
		$("#mainCarousel").hover(
			function(){
				clearInterval(imgTime);
				//显示出左右轮播箭头
				$(".control-wrapper").fadeIn(300);
			},
			function(){
				$(".control-wrapper").hide();
				imgTime = setInterval(function(){
					funLunBo(imgindex);
					imgindex++;
					if(imgindex>=bigImgNum)
						imgindex=0;
				},3000);
			}
		);

		//悬浮小圆点轮播图片
		$("#mainCarousel ol li").mouseenter(function(){
			//获取悬浮的索引
			imgindex = $(this).index();
			funLunBo(imgindex);
		});
		//实现向左切换
		$(".left.carousel-control").click(function(){
			//获取到当前轮播的图片
			imgindex = $("#mainCarousel ol li.active").index();
//				alert(imgindex);
			if(imgindex==0){
				imgindex = bigImgNum-1;
			}else{
				imgindex--;
			}
			funLunBo(imgindex);
			return false;
		});
		//实现向右切换
		$(".right.carousel-control").click(function(){
			imgindex = $("#mainCarousel ol li.active").index();
			if(imgindex==bigImgNum-1){
				imgindex = 0;
			}else{
				imgindex++;
			}
			funLunBo(imgindex);
			return false;
		});
	//大图轮播结束
	});
	//轮播图方法
	function funLunBo(imgindex){
		$("#mainCarousel .carousel-inner .item").eq(imgindex).addClass("action").siblings().removeClass("action");
		$("#mainCarousel ol li").eq(imgindex).addClass("active").siblings().removeClass("active");
	}